home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / dos / c / mem.com / TOOLKIT.H < prev   
Encoding:
C/C++ Source or Header  |  1989-12-16  |  2.0 KB  |  81 lines

  1. /*_ toolkit.h   Tue Apr 18 1989   Modified by: Walter Bright */
  2.  
  3. #ifndef TOOLKIT_H
  4. #define TOOLKIT_H
  5.  
  6. /* Define stuff that's different between machines.
  7.  * PROTOTYPING        1 if compiler supports prototyping
  8.  * HOSTBYTESWAPPED    1 if on the host machine the bytes are
  9.  *            swapped (1 for 6809, 68000, 0 for 8088
  10.  *            and VAX).
  11.  */
  12.  
  13. #if __ZTC__
  14. #define PROTOTYPING    1
  15. #define HOSTBYTESWAPPED    0
  16. #define EXIT_SUCCESS    0
  17. #define EXIT_FAILURE    1
  18.  
  19. #define BITSPERBYTE 8
  20. #define SIZEOFINT   sizeof(int)
  21. #define SIZEOFLONG  sizeof(long)
  22.  
  23. #else
  24. #include    "host.h"
  25. #endif
  26.  
  27. /* Static definitions do not appear in the linker .MAP file. Override    */
  28. /* the definition here to make them global if necessary.        */
  29. #ifndef STATIC
  30. #define STATIC    static
  31. #endif
  32.  
  33. #define arraysize(array)    (sizeof(array) / sizeof(array[0]))
  34.  
  35. /* Macros so that we can do prototyping, but still work with non-    */
  36. /* prototyping compilers:                        */
  37.  
  38. #if PROTOTYPING
  39. #if MSC
  40. #define _0
  41. #else
  42. #define _0            void
  43. #endif
  44. #define _1(v)            v
  45. #define _2(v1,v2)        v1,v2
  46. #define _3(v1,v2,v3)        v1,v2,v3
  47. #define _4(v1,v2,v3,v4)        v1,v2,v3,v4
  48. #define _5(v1,v2,v3,v4,v5)    v1,v2,v3,v4,v5
  49. #define _6(v1,v2,v3,v4,v5,v6)    v1,v2,v3,v4,v5,v6
  50. #define _7(v1,v2,v3,v4,v5,v6,v7) v1,v2,v3,v4,v5,v6,v7
  51. #define _8(v1,v2,v3,v4,v5,v6,v7,v8) v1,v2,v3,v4,v5,v6,v7,v8
  52. #define _9(v1,v2,v3,v4,v5,v6,v7,v8,v9) v1,v2,v3,v4,v5,v6,v7,v8,v9
  53. #define _10(v1,v2,v3,v4,v5,v6,v7,v8,v9,v10) v1,v2,v3,v4,v5,v6,v7,v8,v9,v10
  54. #else
  55. #define _0
  56. #define _1(v)
  57. #define _2(v1,v2)
  58. #define _3(v1,v2,v3)
  59. #define _4(v1,v2,v3,v4)
  60. #define _5(v1,v2,v3,v4,v5)
  61. #define _6(v1,v2,v3,v4,v5,v6)
  62. #define _7(v1,v2,v3,v4,v5,v6,v7)
  63. #define _8(v1,v2,v3,v4,v5,v6,v7,v8)
  64. #define _9(v1,v2,v3,v4,v5,v6,v7,v8,v9)
  65. #define _10(v1,v2,v3,v4,v5,v6,v7,v8,v9,v10)
  66. #endif
  67.  
  68. #if PROTOTYPING
  69. #define P(s)    s
  70. #else
  71. #define P(s)    ()
  72. #endif
  73.  
  74. #ifdef DEBUG
  75. #define debug(a)    (a)
  76. #else
  77. #define debug(a)
  78. #endif
  79.  
  80. #endif /* TOOLKIT_H */
  81. 1200 N81N         ......................... ... ...-....1200 N81N         ........